using System;
using System.Collections.Generic;
using Clandestine.Base;
using Clandestine.Input;
using Clandestine.Graphics;
using Clandestine.Graphics.Window;
using Clandestine.Engines.Field;
using System.IO;

namespace GraphicsTest
{
	enum Role
	{
		Up,
		Down,
		Left,
		Right,
		A,
		B
	}

	class MainClass
	{
		public static void Main(string[] args)
		{
			Directory.SetCurrentDirectory("../datas/");
			Console.WriteLine("Clandestine.Input Test");
			 
			InputManager<Role> im = new InputManager<Role>();
				
			im.ButtonPressed += delegate(Role role) {
				Console.WriteLine("{0} pressed", role.ToString("F"));
				Console.WriteLine("\tAnd it's IsPressed value is now {0}", im.IsButtonPressed(role));
			};
			im.ButtonReleased += delegate(Role role) {
				Console.WriteLine("{0} released", role.ToString("F"));
				Console.WriteLine("\tAnd it's IsPressed value is now {0}", im.IsButtonPressed(role));
			};
			
			im.Map(Role.Left, new Button(im.Joysticks[0], 10));
			im.Map(Role.Right, new Button(im.Joysticks[0], 11));
			im.Map(Role.Up, new Button(im.Joysticks[0], 12));
			im.Map(Role.Down, new Button(im.Joysticks[0], 13));
			im.Map(Role.A, new Button(im.Joysticks[0], 2));
			im.Map(Role.B, new Button(im.Joysticks[0], 1));
			
			while (true)
				im.ProcessEvents();
		}
	
		public static void Main2 (string[] args)
		{
		/*
			Map m = new Map(g, "tree-object.xml");
			g.BlockRendering();
			g.RenderLists.Add(m.Levels[0].FloorRenderList);
			g.RenderLists.Add(m.Levels[0].PerpendicularRenderList);
			g.RenderLists.Add(m.Levels[0].SkyRenderList);
			g.UnblockRendering();
			m.RedrawDirty();
			
			Console.ReadKey();*/
		}
	}
}
